package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.WarehouseRawMaterialMapper;
import com.ruoyi.system.domain.WarehouseRawMaterial;
import com.ruoyi.system.service.IWarehouseRawMaterialService;
import com.ruoyi.common.core.text.Convert;

/**
 * 原料信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-31
 */
@Service
public class WarehouseRawMaterialServiceImpl implements IWarehouseRawMaterialService 
{
    @Autowired
    private WarehouseRawMaterialMapper warehouseRawMaterialMapper;

    /**
     * 查询原料信息
     * 
     * @param id 原料信息主键
     * @return 原料信息
     */
    @Override
    public WarehouseRawMaterial selectWarehouseRawMaterialById(Long id)
    {
        return warehouseRawMaterialMapper.selectWarehouseRawMaterialById(id);
    }

    /**
     * 查询原料信息列表
     * 
     * @param warehouseRawMaterial 原料信息
     * @return 原料信息
     */
    @Override
    public List<WarehouseRawMaterial> selectWarehouseRawMaterialList(WarehouseRawMaterial warehouseRawMaterial)
    {
        return warehouseRawMaterialMapper.selectWarehouseRawMaterialList(warehouseRawMaterial);
    }

    /**
     * 新增原料信息
     * 
     * @param warehouseRawMaterial 原料信息
     * @return 结果
     */
    @Override
    public int insertWarehouseRawMaterial(WarehouseRawMaterial warehouseRawMaterial)
    {
        return warehouseRawMaterialMapper.insertWarehouseRawMaterial(warehouseRawMaterial);
    }

    /**
     * 修改原料信息
     * 
     * @param warehouseRawMaterial 原料信息
     * @return 结果
     */
    @Override
    public int updateWarehouseRawMaterial(WarehouseRawMaterial warehouseRawMaterial)
    {
        return warehouseRawMaterialMapper.updateWarehouseRawMaterial(warehouseRawMaterial);
    }

    /**
     * 批量删除原料信息
     * 
     * @param ids 需要删除的原料信息主键
     * @return 结果
     */
    @Override
    public int deleteWarehouseRawMaterialByIds(String ids)
    {
        return warehouseRawMaterialMapper.deleteWarehouseRawMaterialByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除原料信息信息
     * 
     * @param id 原料信息主键
     * @return 结果
     */
    @Override
    public int deleteWarehouseRawMaterialById(Long id)
    {
        return warehouseRawMaterialMapper.deleteWarehouseRawMaterialById(id);
    }
}
